package com.example.sixtrainingdemo.entity;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class Photo {
   int id;
   byte[] data;
   Bitmap bitmap;

   public int getId() {
      return id;
   }

   public void setId(int id) {
      this.id = id;
   }

   public byte[] getData() {
      return data;
   }

   public void setData(byte[] data) {
      this.data = data;
   }

   public Bitmap getBitmap() {
      if (data != null) {
         return BitmapFactory.decodeByteArray(data, 0, data.length);
      } else {
         return null;
      }
   }

   public void setBitmap(Bitmap bitmap) {
      this.bitmap = bitmap;
   }
}
